package cn.wapache.exception;

import java.io.PrintStream;
import java.io.PrintWriter;

import cn.wapache.i18n.I18nException;

public class I18nIllegalStateException extends IllegalStateException {

	private static final long serialVersionUID = -1213374260948832838L;

	private I18nException innerException;
	
	public I18nIllegalStateException(String code, Object... values) {
		innerException = new I18nException(code, values);
	}

	public I18nIllegalStateException(String code, String message,
			Object... values) {
		innerException = new I18nException(code, message, values);
	}

	public I18nIllegalStateException(Throwable cause, String code,
			Object... values) {
		innerException = new I18nException(cause, code, values);
	}

	public I18nIllegalStateException(Throwable cause, String code,
			String message, Object... values) {
		innerException = new I18nException(cause, code, message, values);
	}

	public I18nIllegalStateException(Throwable cause) {
		innerException = new I18nException(cause);
	}

	@Override
	public String getMessage() {
		return innerException.getMessage();
	}

	@Override
	public String getLocalizedMessage() {
		return innerException.getLocalizedMessage();
	}

	@Override
	public synchronized Throwable getCause() {
		return innerException.getCause();
	}

	@Override
	public synchronized Throwable initCause(Throwable cause) {
		return innerException.initCause(cause);
	}

	@Override
	public String toString() {
		return innerException.toString();
	}

	@Override
	public void printStackTrace() {
		innerException.printStackTrace();
	}

	@Override
	public void printStackTrace(PrintStream s) {
		innerException.printStackTrace(s);
	}

	@Override
	public void printStackTrace(PrintWriter s) {
		innerException.printStackTrace(s);
	}

	@Override
	public synchronized Throwable fillInStackTrace() {
		return innerException.fillInStackTrace();
	}

	@Override
	public StackTraceElement[] getStackTrace() {
		return innerException.getStackTrace();
	}

	@Override
	public void setStackTrace(StackTraceElement[] stackTrace) {
		innerException.setStackTrace(stackTrace);
	}

}
